//
//  ViewController.m
//  myDelegate
//
//  Created by izhifei-Devon on 2017/6/7.
//  Copyright © 2017年 izhifei-Devon. All rights reserved.
//

#import "ViewController.h"
#import "delegateViewController.h"


@interface ViewController ()<changeColorDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    delegateViewController * vc = [[delegateViewController alloc]init];
    vc.changeColorDelegate = self;
    [self presentViewController:vc animated:YES completion:nil];
    
}
-(void)changeColor:(UIColor *)color{
    self.view.backgroundColor = color;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
